<!DOCTYPE html>
<html lang="en">
<head>
[#include "/customer/include/static.htm"]
    <link href="${path}/resources/css/user.css?v=2" rel="stylesheet" type="text/css"/>
    <link href="${path}/resources/plug/layui/css/layui.css" rel="stylesheet" type="text/css"/>
    <script src="${path}/resources/plug/layui/layui.js" type="text/javascript"></script>
    <style type="text/css">
        option {
            font-size: 14px;
            line-height: 20px;
        }
    </style>

[#import "/customer/include/pagination.ftl" as p/]
</head>

<body>
<!--头部-->
[#include "/customer/include/header.ftl"]


<div class="member">
    <!--左边-->
[#include "/customer/include/member_left_menu.ftl"]

    <!--左边 end-->
    <div class="memberRight">
        <div class="member_tab">
            <div class="member_tab">
                <a  class="on" href="${path}/member/auth">实名认证</a>
                <a  href="${path}/member/auth/mobile">手机认证</a>
                <a   href="${path}/member/auth/email">邮箱认证</a>
                <a  href="${path}/member/auth/vip">VIP认证</a>
            </div>
        </div>
        <form class="layui-form">
            <div class="member_tab_info">
                <table class="layui-table">
                    <tbody>

                    <tr>
                        <td>真实姓名：</td>
                        <td>
                            <input id="real_name" name="real_name"
                                   value="${(realName.real_name)!'' }" type="text"
                                   [#if ((realName.status)!'')==1]disabled="disabled" [/#if]  class="layui-input" lay-verify="required"/>
                            <input type="hidden" name="id" value="${(realName.id)!'' }">
                        </td>
                    </tr>

                    <tr>
                        <td>身份证号：</td>
                        <td><input name="idnumber" id="idnumber"
                                   value="${(realName.id_number)!'' }" type="text"
                                   [#if ((realName.status)!'')==1 ]disabled="disabled" [/#if] lay-verify="required" class="layui-input"/></td>
                    </tr>
                    [#--<tr>--]
                        [#--<td>身份证(正)：</td>--]
                        [#--<td>--]

                            [#--<a href="${(realName.card_pic1)!'' }" target="_blank"> <img--]
                                    [#--alt="" id="pic1_img" src="${(realName.card_pic1)!'' }"--]
                                    [#--style="width: 322px; height: 120px;"> <input type="hidden" lay-verify="required"--]
                                                                                 [#--name="pic1_src" id="pic1_src"--]
                                                                                 [#--value="${(realName.card_pic1)!''  }"/>--]
                            [#--[#if ((realName.status)!'')!=1&&((realName.status)!'')!=0 ]--]
                                [#--<input type="file" id="pic1" name="cardBTn" class="layui-upload-file">--]
                            [#--[/#if]--]

                        [#--</td>--]
                    [#--</tr>--]
                    </tbody>

                </table>
                <div class="span10">
                [#if ((realName.status)!'')==0 ]
                    <input type="button" name="" value=" 审 核 中 " lay-submit class="layui-btn"  lay-filter="MainForm" />
                [#elseif ((realName.status)!'')==1 ]
                    <input type="button" name="" value="已 认 证" class="layui-btn"disabled style="background-color: #c2c2c2"/>
                [#elseif ((realName.status)!'')==-1 ]
                    <button lay-submit lay-filter="MainForm" class="layui-btn"  style="width: 100px;background-color: #f3485a">重新认证</button>

                [#else]
                    <button lay-submit lay-filter="MainForm" class="layui-btn"  style="width: 100px;background-color: #f3485a">确认提交</button>

                [/#if]
                </div>
            </div>
        </form>
    </div>
</div>

<script>
    $(function() {
        layui.use(['form','upload'],function(){
            var form = layui.form(), $=layui.jquery, layer = layui.layer;
            layui.upload({
                elem:'#pic1'
                ,url: '/system/upload/submit'
                ,success: function(res){
                    if (res["error"] == 0) {

                        $('#pic1_img').attr("src", res["url"]);
                        $('#pic1_src').val(res["url"]);

                    } else {
                        layer.msg(res["message"]);
                    }
                }
            });
            layui.upload({
                elem:'#pic2'
                ,url: '/system/upload/submit'
                ,success: function(res){
                    if (res["error"] == 0) {
                        $('#pic2_img').attr("src", res["url"]);
                        $('#pic2_src').val(res["url"]);

                    } else {
                        layer.msg(res["message"]);
                    }
                }
            });


            form.on('submit(MainForm)', function(data){
                var index = layer.load();
                ajax({
                    url:"${path}/member/auth/certification",
                    data: data.field,
                    success: function(result){
                        layer.msg(result.content,function() {
                            location.reload();
                        });
                        layer.close(index);
                    },
                    complete:function(){
                        layer.close(index);
                    },error:function(){
                        layer.close(index);
                    }
                });
                return false;
            });
        });
    });
</script>

[#include "/customer/include/footer.ftl"]

</body>
</html>
